package application;

import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.stage.Stage;

public class Main extends Application {
	protected static DivePlanner planner = new DivePlanner();
	protected static Map<String, List<DivePlan>> userProfiles = new HashMap<>();
	protected static String currUserProfile = "";
	protected static NAUITable currTable = null;

	@Override
	public void start(Stage stage) {
		try {
			Parent root = FXMLLoader.load(this.getClass().getResource(
					"Dive.fxml"));

			Scene scene = new Scene(root);

			stage.setScene(scene);
			stage.setHeight(629);
			stage.setWidth(406);
			stage.setResizable(false);
			stage.setTitle("Team Cappelletti");
			stage.show();
		} catch (IOException ex) {
			Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
		}
	}

	/**
	 * @param args
	 *            the command line arguments
	 */
	public static void main(String[] args) {
		launch(args);
	}

	public static void gotoScene(String src, Button btn, Object cls) {
		try {
			Stage currentStage = (Stage) btn.getScene().getWindow();
			// do what you have to do
			currentStage.close();

			Parent rep = FXMLLoader.load(cls.getClass().getResource(src));
			Stage stage = new Stage();
			Scene scene = new Scene(rep);

			stage.setScene(scene);
			stage.setHeight(629);
			stage.setWidth(406);
			stage.setResizable(false);
			stage.setTitle("Team Cappelletti");
			stage.show();
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

}
